<template>
    <section class="search">
        <el-form ref="form" :model="form" label-width="80px">
            <div class="form">
                <asn-field-panel name="名称">
                    <el-input v-model="form.name" placeholder="请输入名称" size="small" clearable />
                </asn-field-panel>
                <asn-button type="primary" name="查询" icon="search" size="small" class="btn" @click="getItems" />
            </div>
        </el-form>
    </section>
</template>

<script>
import _api from '@/common/api/tag'
export default {
    data() {
        return {
            form: {
                name: "",
                pageSize: 10,
                pageIndex: 1
            }
        }
    },
    watch: {

    },
    methods: {
        async getItems() {
            const result = await _api.getAsyncList(this.form)
            this.$emit('getItems', result.data)
        }
    },
    created() {
        this.getItems()
    },
}
</script>

<style lang="scss" scoped>
.search {
    .form {
        display: flex;
        align-items: center;

        .btn {
            margin-left: 5px;
        }
    }
}
</style>